import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { SetMealInfoVO, SetMealInfoForm, SetMealInfoQuery } from '@/api/kitchen/setMeal/info/types';

/**
 * 查询套餐里的美食信息列表
 * @param query
 * @returns {*}
 */

export const listSetMealInfo = (query?: SetMealInfoQuery): AxiosPromise<SetMealInfoVO[]> => {
  return request({
    url: '/kitchen/setMealInfo/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询套餐里的美食信息详细
 * @param id
 */
export const getSetMealInfo = (id: string | number): AxiosPromise<SetMealInfoVO> => {
  return request({
    url: '/kitchen/setMealInfo/' + id,
    method: 'get'
  });
};

/**
 * 新增套餐里的美食信息
 * @param data
 */
export const addSetMealInfo = (data: SetMealInfoForm) => {
  return request({
    url: '/kitchen/setMealInfo',
    method: 'post',
    data: data
  });
};


/**
 * 删除套餐里的美食信息
 * @param data
 */
export const removeByInfo = (data: SetMealInfoForm) => {
  return request({
    url: '/kitchen/setMealInfo/removeByInfo',
    method: 'post',
    data: data
  });
};



/**
 * 修改套餐里的美食信息
 * @param data
 */
export const updateSetMealInfo = (data: SetMealInfoForm) => {
  return request({
    url: '/kitchen/setMealInfo',
    method: 'put',
    data: data
  });
};

/**
 * 删除套餐里的美食信息
 * @param id
 */
export const delSetMealInfo = (id: string | number | Array<string | number>) => {
  return request({
    url: '/kitchen/setMealInfo/' + id,
    method: 'delete'
  });
};
